.data-table {
  background-color: #ffffff;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
  overflow: hidden;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* 滚动条宽度变量 */
  --scrollbar-width: 17px;
}

/* 搜索区域样式已移至 SearchHeader 组件 */

.data-table__stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.data-table__stat-number {
  font-size: 28px;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 8px;
}

.data-table__stat-label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.data-table__container {
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  min-width: 100%;
  flex: 1;
  max-height: calc(100vh - 120px); /* 为导航栏和分页组件预留空间 */
  padding-right: 0; /* 移除右侧padding，让表头覆盖滚动条 */
  /* 滚动条宽度检测 */
  scrollbar-gutter: stable;
}

/* 浅绿色简约风格滚动条 */
.data-table__container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.data-table__container::-webkit-scrollbar-track {
  background: #f0f9f0;
  border-radius: 3px;
}

.data-table__container::-webkit-scrollbar-thumb {
  background: #a7f3d0;
  border-radius: 3px;
  border: 1px solid #d1fae5;
}

.data-table__container::-webkit-scrollbar-thumb:hover {
  background: #6ee7b7;
  border: 1px solid #a7f3d0;
}

.data-table__container::-webkit-scrollbar-thumb:active {
  background: #34d399;
}

.data-table__table {
  width: 100%;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  table-layout: fixed;
}

.data-table__header {
  background-color: #f8f9fa;
  position: sticky;
  top: 0;
  z-index: 15;
  margin-right: calc(-1 * var(--scrollbar-width)); /* 覆盖滚动条宽度 */
  padding-right: var(--scrollbar-width); /* 补偿滚动条宽度 */
}

.data-table__th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 1px solid #e1e5e9;
  white-space: nowrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  border-left: none;
  border-right: none;
  border-top: none;
}

.data-table__th--actions {
  position: sticky;
  right: 0;
  background-color: #f8f9fa;
  z-index: 20;
  border-left: 1px solid #e1e5e9;
  width: 120px !important;
  min-width: 120px;
  max-width: 120px;
  margin-right: calc(-1 * var(--scrollbar-width)); /* 覆盖滚动条 */
  padding-right: var(--scrollbar-width); /* 补偿滚动条宽度 */
  padding-left: 8px; /* 减少左边距 */
  text-align: center; /* 表头居中 */
}

.data-table__body {
  background-color: #ffffff;
}

.data-table__row {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.15s ease;
}

.data-table__row:last-child {
  border-bottom: none;
}

.data-table__row:hover {
  background-color: #f8f9fa;
}

.data-table__td {
  padding: 12px 16px;
  vertical-align: top;
  color: #2c3e50;
  user-select: text; /* 允许选中表格数据 */
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  font-size: 14px;
  position: relative;
  border: none;
}

.data-table__td--actions {
  position: sticky;
  right: 0;
  background-color: #ffffff;
  z-index: 5;
  border-left: 1px solid #f1f3f4;
  text-align: right;
  width: 120px !important;
  min-width: 120px;
  max-width: 120px;
  margin-right: calc(-1 * var(--scrollbar-width)); /* 覆盖滚动条 */
  padding-right: var(--scrollbar-width); /* 补偿滚动条宽度 */
  padding-left: 8px; /* 减少左边距 */
}

.data-table__row:hover .data-table__td--actions {
  background-color: #f8f9fa;
}

.data-table__pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: #f8f9fa;
  border-top: 1px solid #e1e5e9;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.data-table__pagination--single-page {
  justify-content: flex-start;
}

.data-table__pagination-left {
  display: flex;
  align-items: center;
}

.data-table__page-size {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
}

.data-table__pagination-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.data-table__page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-table__page-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #f0f9f0 0%, #e6f7e6 100%);
  border-color: #4ade80;
  color: #22c55e;
}

.data-table__page-btn--active {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(74, 222, 128, 0.2);
}

.data-table__page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.data-table__page-ellipsis {
  padding: 0 8px;
  color: #6b7280;
  font-size: 14px;
}

.data-table__pagination-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table__page-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.data-table__page-input {
  width: 60px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.data-table__page-input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.data-table__page-total {
  color: #6b7280;
}

/* 操作链接样式 */
.data-table__action-link {
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease;
  margin-right: 12px;
  white-space: nowrap;
  display: inline-block;
}

.data-table__action-link:last-child {
  margin-right: 24;
}

.data-table__action-link:hover {
  color: #1f2937;
  text-decoration: underline;
}

.data-table__action-link--edit {
  color: #22c55e;
}

.data-table__action-link--edit:hover {
  color: #16a34a;
}

.data-table__action-link--delete {
  color: #dc2626;
}

.data-table__action-link--delete:hover {
  color: #b91c1c;
}

/* 桌面端窗口过窄时的处理 */
@media (max-width: 1200px) and (min-width: 769px) {
  .data-table__stats {
    gap: 20px;
    padding: 16px;
  }
  
  .data-table__stat-number {
    font-size: 24px;
  }
  
  .data-table__table {
    min-width: 900px;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .data-table {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    height: 100%;
  }
  
  /* 搜索区域响应式样式已移至 SearchHeader 组件 */
  
  .data-table__pagination {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background-color: #f8f9fa;
    border-top: 1px solid #e1e5e9;
  }
  
  .data-table__pagination-left,
  .data-table__pagination-right {
    justify-content: center;
  }
  
  .data-table__pagination-center {
    justify-content: center;
  }
  
  .data-table__table {
    min-width: 800px;
  }
  
  .data-table__th--actions,
  .data-table__td--actions {
    width: 100px !important;
    min-width: 100px;
    max-width: 100px;
  }
  
  .data-table__header {
    position: sticky;
    top: 0;
    z-index: 15;
    margin-right: -17px;
    padding-right: 17px;
  }
  
  .data-table__th--actions {
    z-index: 20;
    margin-right: -17px;
    padding-right: 17px;
    padding-left: 8px;
  }
  
  .data-table__td--actions {
    margin-right: -17px;
    padding-right: 17px;
    padding-left: 8px;
  }
}

/* 文件列表样式 */
.data-table__file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.data-table__file-item {
  display: flex;
  align-items: center;
}

.data-table__file-name {
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.2s ease;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table__file-name:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.data-table__no-files {
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}